﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FisheryPlatform.Entity;
using FisheryPlatform.DataAccess.ShareCode;

namespace FisheryPlatform.Bussiness.ShareCode
{
    public class ShareCodeManager
    {
        public static bool SaveShareCodeClass(ShareCodeClassEntity ClassInfo)
        {
            return ShareCodeClassDB.Save(ClassInfo);
        }

        public static List<ShareCodeClassEntity> GetAllShareCodeClass()
        {
            var pageCount = 0;
            return ShareCodeClassDB.Search("", 0, 0, out pageCount);
        }

        public static ShareCodeClassEntity GetByShareCodeClassId(long classID)
        {
            return ShareCodeClassDB.GetByClassId(classID);
        }

        #region
        public static List<ShareCodeEntity> GetShareCodeListByClassId(long classId)
        {
            return ShareCodeDB.GetByClassId(classId);
        }

        public static List<ShareCodeEntity> GetShareCodeListByClassIdAndPId(long classId, long parentId)
        {
            return ShareCodeDB.GetShareCodeListByClassIdAndPId(classId, parentId);
        }

        public static ShareCodeEntity GetShareCodeById(long codeId)
        {
            return ShareCodeDB.GetByShareCodeId(codeId);
        }

        public static bool SaveShareCode(ShareCodeEntity shareCode)
        {
            return ShareCodeDB.Save(shareCode);
        }
        #endregion
    }
}
